import request from '@/utils/request'

// 添加排课课程
export function addscheduleCourse(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/scheduleCourse/add',
    method: 'post',
    data: query
  })
}

// 根据状态查询排课课程列表
export function scheduleCourseList(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/scheduleCourse/pageList',
    method: 'get',
    params: query
  })
}

// 获取所有带排课学生数量
export function getWaitScheduleNumber(query) {
  return request({
    url: '/jbl-schedule/api/merchant/v1/courseStudent/getWaitScheduleNumber',
    method: 'get',
    params: query
  })
}

// 查询带排课或者已排课学生集合
export function getStudentByStatus(query) {
  return request({
    url: '/jbl-business/api/merchant/v1/student/getStudentByStatus',
    method: 'get',
    params: query
  })
}

// 查询机构的所有带排课学生
export function getWaitScheduled(query) {
  return request({
    url: '/jbl-schedule/api/merchant/v1/courseStudent/getWaitScheduled',
    method: 'get',
    params: query
  })
}

// 获取排课课程详情
export function getScheduleCourseById(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/scheduleCourse/getById',
    method: 'get',
    params: query
  })
}

// 排课课程-----编辑课程
export function updateById(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/scheduleCourse/updateById',
    method: 'post',
    data: query
  })
}

// 排课课程---------删除排课课程
export function deleteById(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/scheduleCourse/deleteById',
    method: 'get',
    params: query
  })
}

// 课程排课-----根据套餐编号及排课课程编号查询学生编号集合
export function getStudentIds(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/courseStudent/getStudentIds',
    method: 'get',
    params: query
  })
}

// 课程排课-----根据课程和套餐查询学生
export function getStudentIdInPage(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/courseStudent/getStudentIdInPage',
    method: 'get',
    params: query
  })
}

// 课程排课-----根据课程编号查询套餐集合
export function getByCourseId(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/courseStudent/getByCourseId',
    method: 'get',
    params: query
  })
}

// 课程排课-----排课时添加学生的展示列表；不在该课程或者该套餐内的学生列表
export function getStudentOutLis(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/courseStudent/getStudentOutList',
    method: 'get',
    params: query
  })
}

// 课程排课-----向排课课程中添加学生
export function addCourseStudent(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/courseStudent/add/student/course',
    method: 'get',
    params: query
  })
}

// 课程排课----学员操作------移除学员
export function removeCourseStudent(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/courseStudent/remove/student',
    method: 'get',
    params: query
  })
}

// 课程排课----验证排课是否时间冲突
export function verificationTime(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/scheduleDetails/verificationTime',
    method: 'get',
    params: query
  })
}

// 课程排课------根据排课课程进行排课
export function generateLesson(query) {
  return request({
    url: 'jbl-schedule/api/merchant/v1/scheduleDetails/generate/lesson',
    method: 'post',
    data: query
  })
}
